package cn.funeralobjects.common.web.controller;

import cn.funeralobjects.common.enums.SimpleStatus;
import cn.funeralobjects.common.web.controller.converter.SimpleStatusPropertyEditorRegistrar;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;

/**
 * 带有SimpleControllerBinder的接口
 *
 * @author FuneralObjects
 * Create date: 2020/4/27 5:40 PM
 */
public interface SimpleStatusControllerBinder {

    /**
     * 初始化数据绑定
     *
     * @param webDataBinder web数据绑定器
     */
    @InitBinder
    default void initSimpleStatusBinder(WebDataBinder webDataBinder) {
        webDataBinder.registerCustomEditor(SimpleStatus.class, new SimpleStatusPropertyEditorRegistrar.SimpleStatusPropertyEditor());
    }
}
